import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { Type } from "../../../../../Decorator/Decorator";
import { ETTask } from "../../../../../Support/Share/Lib/Async/ETTask";
import { MessageClassConstructor } from "../../../Share/Module/Message/IMHandler";

export interface IMActorHandler {

    SetupRequestType(value: MessageClassConstructor): void;
    SetupResponseType(value: MessageClassConstructor): void;

    Handle(entity: Entity, fromProcess: number, actorMessage: Object): Promise<any>;
    GetRequestType(): Type;
    GetResponseType(): Type;
}

export class IMActorHandler {

    _RequestType: MessageClassConstructor = null;
    _ResposeType: MessageClassConstructor = null;

    SetupRequestType(value: MessageClassConstructor): void {
        this._RequestType = value;
    }

    SetupResponseType(value: MessageClassConstructor): void {
        this._ResposeType = value;
    }

    async Handle(entity: Entity, fromProcess: number, actorMessage: Object): Promise<any> {
        return ETTask.CompletedTask;
    }

    GetRequestType(): Type {
        return null;
    }

    GetResponseType(): Type {
        return null;
    }

}